package com.lemon.boot.common.properties;

import com.aliyun.teaopenapi.models.Config;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author 李猛
 * @datetime 2024/7/26 12:18
 * @description 短信
 */

@Setter
@Getter
@Component
@ConfigurationProperties(prefix = "aliyun.sms")
public class SmsConfigProperties {
    //阿里云短信服务ID
    private String accessKeyId;
    //阿里云短信服务秘钥
    private String accessKeySecret;
    //阿里云短信端点
    private String endpoint;
    //短信签名
    private String signName;

    /**
     * 配置信息
     *
     * @return
     */
    public Config getConfig() {
        return new Config()
                .setAccessKeyId(accessKeyId)
                .setAccessKeySecret(accessKeySecret)
                .setEndpoint(endpoint);
    }
}
